package com.wwp.tbshop.activity;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import com.wwp.tbshop.R;
import com.wwp.tbshop.accout_center.presenter.GetUeserId_presenter;
import com.wwp.tbshop.model.bean.UserInfoBean;

import butterknife.Bind;
import butterknife.ButterKnife;


/**
 * Created by Administrator on 6/15/2017.
 */

public class UserActivity extends Activity {

    public GetUeserId_presenter mGetUeserId_presenter;
    @Bind(R.id.username)
    TextView mUsername;
    @Bind(R.id.member)
    TextView mMember;
    @Bind(R.id.integal)
    TextView mIntegal;
    @Bind(R.id.address)
    TextView mAddress;
/*    @Bind(R.id.shoucang)
    TextView mShoucang;*/
    @Bind(R.id.love)
    TextView mLove;
    @Bind(R.id.shop)
    TextView mShop;
    @Bind(R.id.exit)
    Button mExit;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.user_activity);
        ButterKnife.bind(this);
//        mGetUeserId_presenter = new_goods GetUeserId_presenter(this);
//        initConnect();

    }

    private void initConnect() {

        // 进入账号中心   保存了userid ---> 用户界面
        //                没有保存 --》 登录 和 注册页面
        mGetUeserId_presenter.loadUserNewsInfo("154636");

    }


    public void successForBack(UserInfoBean userInfoBean) {
        //数据请求成功
        Toast.makeText(this, userInfoBean.toString(), Toast.LENGTH_SHORT).show();

        String bonus = userInfoBean.getUserInfo().getBonus();
        String level = userInfoBean.getUserInfo().getLevel();
        String userid = userInfoBean.getUserInfo().getUserid();

        mUsername.setText("用户名：     "+userid);
        mMember.setText(level);
        mIntegal.setText("      "+"积分:"+bonus);
    }
}
